/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.poemmanager.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.NotBlank;

/**
* @description /
* @author hwl
* @date 2024-12-06
**/
@Data
@TableName("poet")
public class Poet implements Serializable {

    @TableId(value = "poet_id")
    @ApiModelProperty(value = "主键id")
    private Integer poetId;

    @NotBlank
    @ApiModelProperty(value = "诗人名字")
    private String name;

    @ApiModelProperty(value = "日期")
    private Timestamp birthDate;

    @ApiModelProperty(value = "死亡日期")
    private Timestamp deathDate;

    @ApiModelProperty(value = "国家")
    private String nationality;

    @ApiModelProperty(value = "生平简介")
    private String biography;

    @ApiModelProperty(value = "朝代")
    private String era;

    @ApiModelProperty(value = "性别（0女，1男）")
    private Integer gender;

    public void copy(Poet source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
